import request from '../request';

/**
 * 峰谷时段设置	
 */
export const setPriorityPeriod = (list) => {
	return request({
		url: '/vilion/siteSet/setPriorityPeriod',
		method: 'POST',
		data: list
	});
}

/**
 * 峰谷时段设置查询
 */
export const selectPriorityPeriod = (siteId) => {
	return request({
		url: '/vilion/siteSet/selectPriorityPeriod',
		method: 'GET',
		data: {
			siteId
		}
	});
}

/**
 * 峰谷运行参数设置	
 */
export const setToleranceMaxPowerDto = (params) => {
	return request({
		url: '/vilion/siteSet/setToleranceMaxPowerDto',
		method: 'POST',
		data: params
	});
}

/**
 * 峰谷运行参数查询
 */
export const selectToleranceMaxPowerDto = (siteId) => {
	return request({
		url: '/vilion/siteSet/selectToleranceMaxPowerDto',
		method: 'GET',
		data: {
			siteId
		}
	});
}

/**
 * 峰谷尖峰月设置	
 */
export const setPeakMonths = (params) => {
	return request({
		url: '/vilion/siteSet/setPeakMonths',
		method: 'POST',
		data: params
	});
}

/**
 * 峰谷尖峰月查询
 */
export const selectPeakMonths = (siteId) => {
	return request({
		url: '/vilion/siteSet/selectPeakMonths',
		method: 'GET',
		data: {
			siteId
		}
	});
}

/**
 * 峰谷电价设置	
 */
export const setFeeConfig = (params) => {
	return request({
		url: '/vilion/siteSet/setFeeConfig',
		method: 'POST',
		data: params
	});
}

/**
 * 峰谷电价设置查询
 */
export const selectFeeConfig = (siteId) => {
	return request({
		url: '/vilion/siteSet/selectFeeConfig',
		method: 'GET',
		data: {
			siteId
		}
	});
}

/**
 * 设备参数设置	
 */
export const setDeviceParameter = params => {
	return request({
		url: '/vilion/siteSet/setDeviceParameter',
		method: 'POST',
		data: params
	});
}

/**
 * 设备参数设置查询
 */
export const selectDeviceParameter = (siteId) => {
	return request({
		url: `/vilion/siteSet/selectDeviceParameter?siteId=${siteId}`,
		method: 'POST',
	});
}

/**
 * OTA升级	
 */
export const setOTAUpdate = (params) => {
	return request({
		url: '/vilion/siteSet/setOTAUpdate',
		method: 'POST',
		data: params
	});
}

/**
 * OTA升级-回退版本	
 */
export const setOTARollbackDetail = (params) => {
	return request({
		url: '/vilion/siteSet/setOTARollbackDetail',
		method: 'GET',
		data: params
	});
}

/**
 * OTA升级-详细信息	
 */
export const setOTAUpdateDetail = data => {
	return request({
		url: '/vilion/siteSet/setOTAUpdateDetail',
		method: 'GET',
		data: data
	});
}

/**
 * OTA升级-模块信息	
 */
export const setOTAUpdateModule = siteId => {
	return request({
		url: '/vilion/siteSet/setOTAUpdateModule',
		method: 'GET',
		data: {
			siteId
		}
	});
}

/**
 * 清除故障	
 */
export const setClearFault = (siteId) => {
	return request({
		url: '/vilion/siteSet/setClearFault',
		method: 'POST',
		data: {
			siteId
		}
	});
}